<template>
  <div class="set-admin-study-line">
    <w-nav-bar
      title="学习时间线"/>
    <WCell
      v-for="(v, k) in models"
      :title="v.title"
      @click="$router.push({name: 'SetAdminStudyLineAdd', query: {id: v._id }})"
      :content="v.content"
      :footer="v.dateStr"
      :key="k"/>
    <w-menu-btn
      :add-router="{ name: 'SetAdminStudyLineAdd' }"
      :dustbin-router="{ name: 'SetAdminStudyLineDustbin' }"/>
  </div>
</template>

<script>
  import StudyTimeLineModel from '@/models/web/StudyTimeLineModel'
  import WCell from '@/components/mobile/cell/00'
  import WMenuBtn from '../../../../com/menu-btn/00'
  export default {
    name: "SetAdminStudyLine",
    components: {
      WCell,
      WMenuBtn
    },
    data() {
      return {
        /**
         * 模型数组
         */
        models: []
      }
    },
    methods: {
      /**
       * 获取所有模型数据
       */
      getModels() {
        StudyTimeLineModel.loadAllModels().then((dataArr) => {
          this.models = dataArr
        }).catch(() => {})
      }
    },
    mounted() {
      this.getModels()
    }
  }
</script>

<style lang="scss" scoped>
  .set-admin-study-line {
  }
</style>
